import java.util.Scanner;

/**
 * @Author liangzai
 * @Description:
 */
public class Test {
    public boolean isPalindrome(String s) {
        Scanner scanner = new Scanner(System.in);
        s = s.toLowerCase();
        int left = 0;
        int right = s.length()-1;
        while (left < right) {
            while (left < right && !isNumberAndCharacter(s.charAt(left))) {
                left++;
            }
            while(left < right && !isNumberAndCharacter(s.charAt(right))) {
                right--;
            }
            if(s.charAt(left) == s.charAt(right)) {
                left++;
                right--;
            }else {
                return false;
            }
        }
        return true;
    }
    private boolean isNumberAndCharacter(char ch) {
        if(Character.isDigit(ch) || Character.isLetter(ch)) {
            return true;
        }
        return false;
    }

    public int firstUniqChar(String s) {
        int[] count = new int[26];
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            count[ch - 'a'] ++;
        }
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            if(count[ch - 'a'] == 1) {
                return i;
            }
        }
        return -1;
    }


    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();

        //1. 字符串的分割    split()

        // String[] ss = str.split(" ");
        // int len = ss[ss.length-1].length();

        // System.out.println(len);

        //2. 找到最后一个空格的下标 ，然后截取空格后的字符串，然后求长度  lastindexOf  subString()
        int index = str.lastIndexOf(" ");
        int len = str.substring(index+1).length();
        System.out.println(len);
    }

    public static void main5(String[] args) {
        String s1 = String.valueOf(1234);
        String s2 = String.valueOf(12.34);
        String s3 = String.valueOf(true);
        System.out.println(s1);
        System.out.println(s2);
        System.out.println(s3);

        /*String s4 = String.valueOf(new Student("gaobo",13));
        System.out.println(s4);*/


        int data1 = Integer.parseInt("1234");
        double data2 = Double.parseDouble("12.34");
        System.out.println(data1+1);
        System.out.println(data2);
    }

    public static void main4(String[] args) {
        String s = "ababcabcd";
        //倒着往回的 第一个ab
        int index = s.lastIndexOf("abc",4);
        System.out.println(index);

       /* int index = s.indexOf('l');//默认是从0位置开始找
        System.out.println(index);


        index = s.indexOf('l',3);
        System.out.println(index);

        index = s.indexOf("ll",3);//默认是从0位置开始找
        System.out.println(index);
*/

        /*for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            System.out.println(ch);
        }*/


        /*char ch = s.charAt(5);
        System.out.println(ch);*/
        /*int[] array = {1,2,3,4,5};
        System.out.println(array.length);*/
    }

    public static void main3(String[] args) {
        String s1 = new String("aeF");
        String s2 = new String("aef");
        //比较字符串的大小
        System.out.println(s1.compareTo(s2));//s1和s2进行比较
        //1. 根据对应字符比较
        //2. 对应字符 无法比较出来 谁大 谁小 此时 就看长度
        System.out.println(s1.compareToIgnoreCase(s2));
    }

    public static void main2(String[] args) {

        String s1 = new String("hello");
        String s2 = new String("hello");
        String s3 = s1;
        System.out.println("=============");
        System.out.println(s1 == s2);//false
        System.out.println(s1 == s3);//true
        System.out.println(s2 == s3);//false
        System.out.println("========================");
        System.out.println(s1.equals(s2));//true
        System.out.println(s1.equals(s3));//true
        System.out.println(s2.equals(s3));//true
    }




    public static void main1(String[] args) {
        String str = "hello";
        String str2 = new String("world");
        char[] value = {'a','b','c'};
        String str3 = new String(value);


        System.out.println(str);
        System.out.println(str2);
        System.out.println(str3);
    }

}
